<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社会安全灾害个人预防知识 - 科普小站</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        security: {
                            50: '#F8FAFC',
                            100: '#F1F5F9',
                            300: '#CBD5E1',
                            500: '#64748B',
                            700: '#334155',
                            900: '#0F172A'
                        }
                    }
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .card-hover { @apply transition-all duration-300 hover:shadow-lg hover:-translate-y-1; }
            .security-icon { @apply w-12 h-12 rounded-full flex items-center justify-center text-xl; }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans text-gray-800">
<!-- 导航栏 -->
<header class="sticky top-0 bg-white shadow-md z-50">
    <div class="container mx-auto px-4">
        <div class="flex items-center justify-between h-16">
            <div class="flex items-center">
                <i class="fa fa-shield text-security-700 text-2xl"></i>
                <h1 class="text-xl font-bold ml-2">社会安全防护知识</h1>
            </div>

            <nav class="hidden md:flex items-center space-x-6">
                <a href="#overview" class="font-medium hover:text-security-700 transition-colors">首页</a>
                <a href="#types" class="font-medium hover:text-security-700 transition-colors">安全类型</a>
                <a href="#prevention" class="font-medium hover:text-security-700 transition-colors">预防措施</a>
                <a href="#response" class="font-medium hover:text-security-700 transition-colors">应对方法</a>
            </nav>

            <button class="md:hidden text-gray-600 hover:text-security-700" id="menu-btn">
                <i class="fa fa-bars"></i>
            </button>
        </div>
    </div>
</header>

<!-- 移动端菜单 -->
<div class="fixed inset-0 bg-white z-40 transform translate-x-full transition-transform duration-300 md:hidden" id="mobile-menu">
    <div class="p-4 border-b flex justify-between">
        <h2 class="text-xl font-bold">菜单</h2>
        <button id="close-menu"><i class="fa fa-times"></i></button>
    </div>
    <div class="p-4 space-y-3">
        <a href="#overview" class="block py-2 hover:text-security-700">首页</a>
        <a href="#types" class="block py-2 hover:text-security-700">安全类型</a>
        <a href="#prevention" class="block py-2 hover:text-security-700">预防措施</a>
        <a href="#response" class="block py-2 hover:text-security-700">应对方法</a>
    </div>
</div>

<!-- 紧急通知 -->
<div class="bg-yellow-50 border-l-4 border-yellow-400 py-3 px-4">
    <div class="container mx-auto flex items-center">
        <i class="fa fa-exclamation-triangle text-yellow-500 mr-3"></i>
        <p><strong>安全提示：</strong>提高警惕，防范电信网络诈骗，不轻信陌生来电和链接</p>
    </div>
</div>

<!-- 主内容区 -->
<main class="container mx-auto px-4 py-8">
    <!-- 概述部分 -->
    <section id="overview" class="mb-12">
        <div class="bg-gradient-to-r from-security-700 to-security-500 rounded-2xl shadow-lg overflow-hidden">
            <div class="flex flex-col md:flex-row">
                <div class="p-6 md:p-8 md:w-1/2 text-white">
                    <h2 class="text-2xl md:text-3xl font-bold mb-4">社会安全灾害防护指南</h2>
                    <p class="mb-6">社会安全灾害包括诈骗、盗窃、抢劫、踩踏等各类人为安全事件，掌握预防和应对技能，能有效保护自身安全。</p>
                    <div class="flex gap-3">
                        <a href="#prevention" class="bg-white text-security-700 px-5 py-2 rounded-lg hover:bg-gray-100 flex items-center">
                            <i class="fa fa-shield mr-2"></i> 预防措施
                        </a>
                        <a href="#response" class="border-2 border-white text-white px-5 py-2 rounded-lg hover:bg-white/10 flex items-center">
                            <i class="fa fa-ambulance mr-2"></i> 应对方法
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2 h-64 md:h-auto">
                    <img src="https://picsum.photos/seed/security/800/600" alt="社会安全防护示意图" class="w-full h-full object-cover">
                </div>
            </div>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-8">
            <div class="bg-white rounded-xl p-6 shadow-sm card-hover">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-security-700 mr-4">
                        <i class="fa fa-eye"></i>
                    </div>
                    <h3 class="text-xl font-bold">风险识别</h3>
                </div>
                <p class="text-gray-600">学习识别各类社会安全风险信号，增强防范意识，避免陷入危险情境。</p>
            </div>

            <div class="bg-white rounded-xl p-6 shadow-sm card-hover">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-security-700 mr-4">
                        <i class="fa fa-lock"></i>
                    </div>
                    <h3 class="text-xl font-bold">安全习惯</h3>
                </div>
                <p class="text-gray-600">养成良好的安全习惯，提高自我保护能力，减少安全事故发生的可能性。</p>
            </div>

            <div class="bg-white rounded-xl p-6 shadow-sm card-hover">
                <div class="flex items-center mb-4">
                    <div class="w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center text-security-700 mr-4">
                        <i class="fa fa-phone"></i>
                    </div>
                    <h3 class="text-xl font-bold">应急处置</h3>
                </div>
                <p class="text-gray-600">掌握基本的应急处置方法和求救技巧，在危险情况下能正确应对，保护自身安全。</p>
            </div>
        </div>
    </section>

    <!-- 安全类型 -->
    <section id="types" class="mb-12">
        <h2 class="text-2xl font-bold mb-6 flex items-center">
            <i class="fa fa-list-alt text-security-700 mr-2"></i> 常见社会安全类型
        </h2>

        <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
            <!-- 诈骗犯罪 -->
            <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover">
                <div class="h-48 overflow-hidden">
                    <img src="https://picsum.photos/seed/fraud/600/400" alt="诈骗犯罪" class="w-full h-full object-cover hover:scale-110 transition-transform duration-500">
                </div>
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="security-icon bg-purple-100 text-purple-600">
                            <i class="fa fa-envelope"></i>
                        </div>
                        <h3 class="text-xl font-bold ml-3">诈骗犯罪</h3>
                    </div>
                    <p class="text-gray-600 mb-4">包括电信诈骗、网络诈骗、街头诈骗等，通过欺骗手段骗取他人财物。</p>
                    <span class="text-sm text-gray-500">常见形式：中奖诈骗、冒充客服</span>
                </div>
            </div>

            <!-- 盗窃抢劫 -->
            <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover">
                <div class="h-48 overflow-hidden">
                    <img src="https://picsum.photos/seed/theft/600/400" alt="盗窃抢劫" class="w-full h-full object-cover hover:scale-110 transition-transform duration-500">
                </div>
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="security-icon bg-red-100 text-red-600">
                            <i class="fa fa-unlock-alt"></i>
                        </div>
                        <h3 class="text-xl font-bold ml-3">盗窃抢劫</h3>
                    </div>
                    <p class="text-gray-600 mb-4">包括入室盗窃、扒窃、抢劫等，以非法占有为目的，侵犯他人财产安全。</p>
                    <span class="text-sm text-gray-500">高发区域：人群密集场所、偏僻地段</span>
                </div>
            </div>

            <!-- 公共安全事件 -->
            <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover">
                <div class="h-48 overflow-hidden">
                    <img src="https://picsum.photos/seed/crowd/600/400" alt="公共安全事件" class="w-full h-full object-cover hover:scale-110 transition-transform duration-500">
                </div>
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="security-icon bg-orange-100 text-orange-600">
                            <i class="fa fa-users"></i>
                        </div>
                        <h3 class="text-xl font-bold ml-3">公共安全事件</h3>
                    </div>
                    <p class="text-gray-600 mb-4">包括踩踏事故、公共场所冲突等，多发生在大型活动和人员密集场所。</p>
                    <span class="text-sm text-gray-500">高发场合：演唱会、体育赛事、节假日</span>
                </div>
            </div>

            <!-- 网络安全 -->
            <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover">
                <div class="h-48 overflow-hidden">
                    <img src="https://picsum.photos/seed/cyber/600/400" alt="网络安全" class="w-full h-full object-cover hover:scale-110 transition-transform duration-500">
                </div>
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="security-icon bg-blue-100 text-blue-600">
                            <i class="fa fa-globe"></i>
                        </div>
                        <h3 class="text-xl font-bold ml-3">网络安全</h3>
                    </div>
                    <p class="text-gray-600 mb-4">包括个人信息泄露、账号被盗、病毒攻击等，威胁个人信息和财产安全。</p>
                    <span class="text-sm text-gray-500">常见风险：钓鱼网站、恶意软件</span>
                </div>
            </div>

            <!-- 家庭暴力 -->
            <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover">
                <div class="h-48 overflow-hidden">
                    <img src="https://picsum.photos/seed/family/600/400" alt="家庭暴力" class="w-full h-full object-cover hover:scale-110 transition-transform duration-500">
                </div>
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="security-icon bg-pink-100 text-pink-600">
                            <i class="fa fa-home"></i>
                        </div>
                        <h3 class="text-xl font-bold ml-3">家庭暴力</h3>
                    </div>
                    <p class="text-gray-600 mb-4">发生在家庭成员之间的暴力行为，包括身体暴力、精神虐待、经济控制等。</p>
                    <span class="text-sm text-gray-500">求助途径：110报警、妇联求助</span>
                </div>
            </div>

            <!-- 校园安全 -->
            <div class="bg-white rounded-xl overflow-hidden shadow-sm card-hover">
                <div class="h-48 overflow-hidden">
                    <img src="https://picsum.photos/seed/school/600/400" alt="校园安全" class="w-full h-full object-cover hover:scale-110 transition-transform duration-500">
                </div>
                <div class="p-6">
                    <div class="flex items-center mb-4">
                        <div class="security-icon bg-green-100 text-green-600">
                            <i class="fa fa-graduation-cap"></i>
                        </div>
                        <h3 class="text-xl font-bold ml-3">校园安全</h3>
                    </div>
                    <p class="text-gray-600 mb-4">包括校园欺凌、校园暴力、意外伤害等，影响学生身心健康和安全。</p>
                    <span class="text-sm text-gray-500">防范重点：提高自我保护意识</span>
                </div>
            </div>
        </div>
    </section>

    <!-- 预防措施 -->
    <section id="prevention" class="mb-12">
        <h2 class="text-2xl font-bold mb-6 flex items-center">
            <i class="fa fa-shield text-security-700 mr-2"></i> 日常预防措施
        </h2>

        <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
            <div class="bg-white rounded-xl shadow-sm p-6">
                <h3 class="text-xl font-bold mb-6">个人安全防范</h3>

                <div class="space-y-4">
                    <div class="flex">
                        <div class="w-10 h-10 bg-security-100 rounded-full flex items-center justify-center text-security-700 mr-4 flex-shrink-0">1</div>
                        <div>
                            <h4 class="font-bold text-lg mb-1">日常出行安全</h4>
                            <p class="text-gray-600">尽量避免单独夜间出行，不前往偏僻地段；随身携带防狼喷雾等防身工具；保持警惕，注意周围环境。</p>
                        </div>
                    </div>

                    <div class="flex">
                        <div class="w-10 h-10 bg-security-100 rounded-full flex items-center justify-center text-security-700 mr-4 flex-shrink-0">2</div>
                        <div>
                            <h4 class="font-bold text-lg mb-1">财物保护</h4>
                            <p class="text-gray-600">随身携带的贵重物品要妥善保管；在公共场所注意看管个人物品；家中门窗要锁好，不给不法分子可乘之机。</p>
                        </div>
                    </div>

                    <div class="flex">
                        <div class="w-10 h-10 bg-security-100 rounded-full flex items-center justify-center text-security-700 mr-4 flex-shrink-0">3</div>
                        <div>
                            <h4 class="font-bold text-lg mb-1">防范诈骗</h4>
                            <p class="text-gray-600">不轻信陌生来电和信息，不随意透露个人信息；不点击不明链接，不下载非官方应用；遇到可疑情况及时核实。</p>
                        </div>
                    </div>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-sm p-6">
                <h3 class="text-xl font-bold mb-6">网络与居家安全</h3>

                <div class="space-y-4">
                    <div class="flex">
                        <div class="w-10 h-10 bg-security-100 rounded-full flex items-center justify-center text-security-700 mr-4 flex-shrink-0">1</div>
                        <div>
                            <h4 class="font-bold text-lg mb-1">网络安全防护</h4>
                            <p class="text-gray-600">设置复杂密码并定期更换；安装杀毒软件并及时更新；不随意连接公共WiFi；不在非官方平台泄露个人信息。</p>
                        </div>
                    </div>

                    <div class="flex">
                        <div class="w-10 h-10 bg-security-100 rounded-full flex items-center justify-center text-security-700 mr-4 flex-shrink-0">2</div>
                        <div>
                            <h4 class="font-bold text-lg mb-1">居家安全措施</h4>
                            <p class="text-gray-600">安装防盗门窗和监控设备；不给陌生人开门；定期检查家中安全隐患；了解小区紧急联系人信息。</p>
                        </div>
                    </div>

                    <div class="flex">
                        <div class="w-10 h-10 bg-security-100 rounded-full flex items-center justify-center text-security-700 mr-4 flex-shrink-0">3</div>
                        <div>
                            <h4 class="font-bold text-lg mb-1">公共场所安全</h4>
                            <p class="text-gray-600">进入公共场所注意观察安全出口位置；参加大型活动时避免拥挤；发现可疑人员或物品及时报告。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- 应对方法 -->
    <section id="response" class="mb-12">
        <h2 class="text-2xl font-bold mb-6 flex items-center">
            <i class="fa fa-ambulance text-security-700 mr-2"></i> 应急应对方法
        </h2>

        <div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
            <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                <div class="flex items-center mb-4">
                    <div class="security-icon bg-red-100 text-red-600 mr-4">
                        <i class="fa fa-unlock-alt"></i>
                    </div>
                    <h3 class="text-lg font-bold">遭遇盗窃抢劫</h3>
                </div>
                <ul class="space-y-2 text-gray-600 text-sm">
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>保持冷静，生命安全第一，不要贸然反抗</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>尽量记住嫌疑人特征，如身高、衣着、口音等</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>脱险后立即报警，详细说明情况和地点</span>
                    </li>
                </ul>
            </div>

            <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                <div class="flex items-center mb-4">
                    <div class="security-icon bg-purple-100 text-purple-600 mr-4">
                        <i class="fa fa-envelope"></i>
                    </div>
                    <h3 class="text-lg font-bold">遭遇诈骗</h3>
                </div>
                <ul class="space-y-2 text-gray-600 text-sm">
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>立即停止与诈骗者的一切联系</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>尽快修改所有相关账号密码</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>保存证据并报警，必要时联系银行冻结账户</span>
                    </li>
                </ul>
            </div>

            <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                <div class="flex items-center mb-4">
                    <div class="security-icon bg-orange-100 text-orange-600 mr-4">
                        <i class="fa fa-users"></i>
                    </div>
                    <h3 class="text-lg font-bold">公共场所拥挤</h3>
                </div>
                <ul class="space-y-2 text-gray-600 text-sm">
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>保持冷静，不逆行，不推挤，顺着人流缓慢移动</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>双手交叉护在胸前，保持呼吸空间</span>
                    </li>
                    <li class="flex items-start">
                        <i class="fa fa-check-circle text-green-500 mt-1 mr-2"></i>
                        <span>如摔倒，立即蜷缩身体保护头部，设法站立</span>
                    </li>
                </ul>
            </div>
        </div>

        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
            <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                <h3 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fa fa-phone text-danger mr-2"></i> 紧急联系电话
                </h3>
                <div class="grid grid-cols-2 gap-4">
                    <div class="bg-gray-50 rounded-lg p-4 text-center">
                        <div class="text-danger text-2xl mb-1">110</div>
                        <div class="text-gray-600 text-sm">报警服务</div>
                    </div>
                    <div class="bg-gray-50 rounded-lg p-4 text-center">
                        <div class="text-danger text-2xl mb-1">119</div>
                        <div class="text-gray-600 text-sm">消防救援</div>
                    </div>
                    <div class="bg-gray-50 rounded-lg p-4 text-center">
                        <div class="text-danger text-2xl mb-1">120</div>
                        <div class="text-gray-600 text-sm">医疗急救</div>
                    </div>
                    <div class="bg-gray-50 rounded-lg p-4 text-center">
                        <div class="text-security-700 text-2xl mb-1">12345</div>
                        <div class="text-gray-600 text-sm">市民服务热线</div>
                    </div>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-sm p-6 card-hover">
                <h3 class="text-xl font-bold mb-4 flex items-center">
                    <i class="fa fa-shield text-security-700 mr-2"></i> 个人安全防护包
                </h3>
                <div class="space-y-2">
                    <div class="flex items-center">
                        <input type="checkbox" class="mr-2 h-4 w-4 text-security-700">
                        <span class="text-gray-600">防狼喷雾/警报器</span>
                    </div>
                    <div class="flex items-center">
                        <input type="checkbox" class="mr-2 h-4 w-4 text-security-700">
                        <span class="text-gray-600">应急手电筒（带爆闪功能）</span>
                    </div>
                    <div class="flex items-center">
                        <input type="checkbox" class="mr-2 h-4 w-4 text-security-700">
                        <span class="text-gray-600">少量现金和重要联系方式</span>
                    </div>
                    <div class="flex items-center">
                        <input type="checkbox" class="mr-2 h-4 w-4 text-security-700">
                        <span class="text-gray-600">简易急救包（创可贴、消毒棉片）</span>
                    </div>
                    <div class="flex items-center">
                        <input type="checkbox" class="mr-2 h-4 w-4 text-security-700">
                        <span class="text-gray-600">手机备用电池/充电宝</span>
                    </div>
                </div>
            </div>
        </div>
    </section>
</main>

<!-- 页脚 -->
<footer class="bg-security-900 text-white py-8">
    <div class="container mx-auto px-4">
        <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
            <div>
                <div class="flex items-center space-x-2 mb-4">
                    <i class="fa fa-shield text-gray-400 text-2xl"></i>
                    <h2 class="text-xl font-bold">社会安全防护知识</h2>
                </div>
                <p class="text-gray-400 text-sm">
                    普及社会安全知识，提高公众安全意识和自我保护能力，共建安全和谐社会。
                </p>
            </div>

            <div>
                <h3 class="text-lg font-medium mb-4">快速链接</h3>
                <ul class="space-y-2 text-gray-400">
                    <li><a href="#overview" class="hover:text-white transition-colors">首页</a></li>
                    <li><a href="#types" class="hover:text-white transition-colors">安全类型</a></li>
                    <li><a href="#prevention" class="hover:text-white transition-colors">预防措施</a></li>
                    <li><a href="#response" class="hover:text-white transition-colors">应对方法</a></li>
                </ul>
            </div>

            <div>
                <h3 class="text-lg font-medium mb-4">相关资源</h3>
                <ul class="space-y-2 text-gray-400">
                    <li><a href="#" class="hover:text-white transition-colors">公安部官网</a></li>
                    <li><a href="#" class="hover:text-white transition-colors">中国普法网</a></li>
                    <li><a href="#" class="hover:text-white transition-colors">应急管理部</a></li>
                </ul>
            </div>

            <div>
                <h3 class="text-lg font-medium mb-4">联系我们</h3>
                <ul class="space-y-2 text-gray-400">
                    <li class="flex items-center">
                        <i class="fa fa-envelope mr-2"></i>
                        <span>safety@social-security.com</span>
                    </li>
                    <li class="flex items-center">
                        <i class="fa fa-phone mr-2"></i>
                        <span>400-123-4567</span>
                    </li>
                </ul>
            </div>
        </div>

        <div class="border-t border-security-700 mt-8 pt-6 text-center text-gray-500 text-sm">
            <p>&copy; 2025 社会安全防护知识网 | 本网站信息仅供参考，具体请以官方发布为准</p>
        </div>
    </div>
</footer>

<!-- 回到顶部按钮 -->
<button id="back-to-top" class="fixed bottom-6 right-6 bg-security-700 text-white w-12 h-12 rounded-full flex items-center justify-center shadow-lg opacity-0 invisible transition-all duration-300 hover:bg-security-500">
    <i class="fa fa-arrow-up"></i>
</button>

<!-- 脚本 -->
<script>
    // 初始化页面
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化回到顶部按钮
        initBackToTopButton();

        // 初始化平滑滚动
        initSmoothScroll();

        // 初始化移动端菜单
        initMobileMenu();
    });

    // 回到顶部按钮
    function initBackToTopButton() {
        const backToTopButton = document.getElementById('back-to-top');

        window.addEventListener('scroll', function() {
            if (window.pageYOffset > 300) {
                backToTopButton.classList.remove('opacity-0', 'invisible');
                backToTopButton.classList.add('opacity-100', 'visible');
            } else {
                backToTopButton.classList.add('opacity-0', 'invisible');
                backToTopButton.classList.remove('opacity-100', 'visible');
            }
        });

        backToTopButton.addEventListener('click', function() {
            window.scrollTo({
                top: 0,
                behavior: 'smooth'
            });
        });
    }

    // 平滑滚动
    function initSmoothScroll() {
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function(e) {
                e.preventDefault();

                const targetId = this.getAttribute('href');
                if (targetId === '#') return;

                const targetElement = document.querySelector(targetId);
                if (targetElement) {
                    window.scrollTo({
                        top: targetElement.offsetTop - 80,
                        behavior: 'smooth'
                    });

                    // 关闭移动端菜单
                    const mobileMenu = document.getElementById('mobile-menu');
                    if (!mobileMenu.classList.contains('translate-x-full')) {
                        mobileMenu.classList.add('translate-x-full');
                    }
                }
            });
        });
    }

    // 移动端菜单
    function initMobileMenu() {
        const menuBtn = document.getElementById('menu-btn');
        const closeBtn = document.getElementById('close-menu');
        const mobileMenu = document.getElementById('mobile-menu');

        menuBtn.addEventListener('click', function() {
            mobileMenu.classList.remove('translate-x-full');
        });

        closeBtn.addEventListener('click', function() {
            mobileMenu.classList.add('translate-x-full');
        });
    }
</script>
</body>
</html>
